package test;

import java.util.*;

public class keda1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        if(str.length() == 1){
            System.out.println(str);
            return;
        }
        String ans = "";
        for (int i = 0; i < str.length(); i++) {
            int t = 1;
            while(i + 1 < str.length() && str.charAt(i) == str.charAt(i + 1)){
                i++;
                t++;
            }
            if(t == 1){
                ans += str.charAt(i);
            }
            else{
                ans += t + "" + str.charAt(i);
            }
        }
        System.out.println(ans);
    }
}
